{include file='header.tpl'}

{if (($view == 'allfriends') || !$view)}
<p><b>New stuff from my friends.</b></p>

{if $friends_media|@count > 0}
<table>
<tr>

{foreach from=$friends_media item=media}
{assign var='i' value='1'}
	<td>
		{$media.title}<br />
		<a href="/media/browse/user/{$media.username}">{$media.username}</a><br />
		<a href="/media/view/url/{$media.url}"><img src="{$media.thumb_url}" border="0" /></a><br />
		<span style="font-size: 10px;">{$media.date|date_format:"%B %e, %Y"}, {$media.date|date_format:"%l:%M%p"|lower}</span><br />
	</td>

	{if ($i % 6) == 0}
		</tr><tr>
	{/if}

	{assign var='i' value=`$i+1`}
{/foreach}

</tr>

<!-- Pagination -->
{if ($friends_media_total > $limit)}
<tr>
	<td>
	{if ($page > 1)}
		<a href="/relationship/followings/view/allfriends/p/{$page-1}">&laquo; PREV</a>
	{else}
		<span style="color: silver;">&laquo PREV</span>
	{/if}

	{if ((($page) * $limit) < $friends_media_total)}
		<a href="/relationship/followings/view/allfriends/p/{$page+1}">NEXT &raquo;</a>
	{else}
		<span style="color: silver;">NEXT &raquo;</span>
	{/if}
	</td>
</tr>
{/if}
<!-- End Pagination -->

{if !$view} 
<tr>
	<td colspan="5" style="text-align: right;"><a href="/relationship/followings/view/allfriends">View All</a>
	</td>
</tr>
{/if}

</table>
{else}
None.
{/if}
{/if}

{if (($view == 'allfollowing') || !$view)}
<p><b>New stuff from people I'm following.</b></p>

{if $followed_media|@count > 0}

<table>
<tr>

{foreach from=$followed_media item=media}
{assign var='i' value='1'}
	<td>
		{$media.title}<br />
		<a href="/media/browse/user/{$media.username}">{$media.username}</a><br />
		<a href="/media/view/url/{$media.url}"><img src="{$media.thumb_url}" border="0" /></a><br />
		<span style="font-size: 10px;">{$media.date|date_format:"%B %e, %Y"}, {$media.date|date_format:"%l:%M%p"|lower}</span><br />
	</td>

	{if ($i % 6) == 0}
		</tr><tr>
	{/if}

	{assign var='i' value=`$i+1`}
{/foreach}

</tr>

<!-- Pagination -->
{if ($followed_media_total > $limit)}
<tr>
	<td>
	{if ($page > 1)}
		<a href="/relationship/followings/view/allfollowing/p/{$page-1}">&laquo; PREV</a>
	{else}
		<span style="color: silver;">&laquo PREV</span>
	{/if}

	{if ((($page) * $limit) < $followed_media_total)}
		<a href="/relationship/followings/view/allfollowing/p/{$page+1}">NEXT &raquo;</a>
	{else}
		<span style="color: silver;">NEXT &raquo;</span>
	{/if}
	</td>
</tr>
{/if}
<!-- End Pagination -->

{if !$view} 
<tr>
	<td colspan="5" style="text-align: right;"><a href="/relationship/followings/view/allfollowing">View All</a>
	</td>
</tr>
{/if}

</table>

{else}
None.
{/if}
{/if}


{if (($view == 'photocomments') || !$view)}
<p><b>Latest comments on my stuff.</b></p>

{if $new_comments|@count > 0}

	{foreach from=$new_comments item=new_comment}
		<div style="margin-bottom: 20px;">
		<b><a href="/media/view/url/{$new_comment.photo_url}">{$new_comment.photo_title}</a></b>

		{foreach from=$new_comment.comments item=comment}
			<div>"{$comment.comment}" by <a href="/user/info/username/{$comment.username}">{$comment.username}</a> 
				on {$comment.date|date_format:"%B %e, %Y"}, {$comment.date|date_format:"%l:%M%p"|lower}</div>
		{/foreach}
		</div>
	{/foreach}
{/if}

{if !$view} 
<div style="text-align: right;"><a href="/relationship/followings/view/photocomments">View All</a></div>
{/if}

{/if}


{if (($view == 'replycomments') || !$view)}
<p><b>Replies to my comments.</b></p>

{if $reply_comments|@count > 0}

	{foreach from=$reply_comments item=reply_comment}
		<div style="margin-bottom: 20px;">
		<b><a href="/media/view/url/{$reply_comment.url}">{$reply_comment.title}</a></b>
		<div style="font-style: italic;">My comment: {$reply_comment.original_comment.comment} on {$reply_comment.original_comment.date|date_format:"%B %e, %Y"}, 
			{$reply_comment.original_comment.date|date_format:"%l:%M%p"|lower}</div>

		{foreach from=$reply_comment.comments item=comment}
			<div>"{$comment.comment}" by <a href="/user/info/username/{$comment.username}">{$comment.username}</a> 
				on {$comment.date|date_format:"%B %e, %Y"}, {$comment.date|date_format:"%l:%M%p"|lower}</div>
		{/foreach}
		</div>
	{/foreach}
{/if}

{if !$view} 
<div style="text-align: right;"><a href="/relationship/followings/view/replycomments">View All</a></div>
{/if}

{/if}

{include file='footer.tpl'}
